package com.android.nvssdklib;

import com.android.RegServerTypes.LogOnInfo;
import com.android.RegServerTypes.ProxyInfo;
import com.android.RegServerTypes.REG_DNS;
import com.android.RegServerTypes.REG_NVS;

@SuppressWarnings("ALL")
public class NvssdkAPI {
	public boolean blHeader;
	//nvssdk��������ʼ��
	public native int InitalNvssdk(String _strLibPath);
	
	public native int GetSource(byte[]sur, byte[]des);
	
	//public native int NetClient_SetBitmap(int _iLogonID, Bitmap bitmap);
	public native int NetClient_SetYuvNotify(Object obj);
	public native int SetHandle(int _iWinNO, int _iLogonID, Object obj, byte[] _buf);
	//
	public native int NetClient_Startup(int _iServerPort,int _iClientPort);
	public native int NetClient_Cleanup();
	public native int NetClient_GetVersion(char[] _pVersion);
	
	public native int NetClient_Logon(String _strProxy, String _strIP, String _strUserName, String _strPwd, String _strProductID,int _iPort);
	public native int NetClient_Logoff(int _iLogonID);
	public native int NetClient_GetLogonStatus(int _iLogonID);
	public native int NetClient_SetNotifyFunction(Object obj);	
	
	public native int NetClient_StartRecv(int[] _iRecvID, CLIENTINFOR _cltInfo);
	public native int NetClient_StopRecv(int _uiRecvID);
	public native int NetClient_GetRecvID(int _iLogonID, int _iChannel, int _iStreamNO);
	public native int NetClient_GetInfoByConnectID(int _iConnectID,CONNECTINFOR _stConnectInfo);
	public native int NetClient_GetDevInfo(int _iLogonID, ENCODERINFOR  _pEncoderInfo);
	
	public native int NetClient_StartCaptureData(long _ulID);
	public native int NetClient_StopCaptureData(long _ulID);

	public native int NetClient_GetVideoHeader(long _ulID, char[] _pcHeader);

	public native int NetClient_StartCaptureFile(int _iRecvID, String _strFilePath, int _iRecordFileType);
	public native int NetClient_StopCaptureFile(int _uiRecvID);
	public native int NetClient_GetCaptureStatus(int	_ulConID);
	
	public native int NetClient_StartPlay(int _ulID, int _hWnd, RECT _rcShow, int _iDecflag);
	public native int NetClient_StopPlay(int _ulID);
	public native int NetClient_ResetPlayerWnd(int _ulID, int _hwnd);
	public native int NetClient_GetPlayingStatus(int _ulID);
	public native int NetClient_AdjustVideo(int _ulID, RECT _rctShow);
	
	public native int NetClient_AudioStart(int _ulID);
	public native int NetClient_AudioStop(int _ulID);
	public native int NetClient_SetLocalAudioVolume(int _iVolume);    
	
	public native int NetClient_SetBufferNum(int _ulID, int _iNum);
	public native int NetClient_SetPlayDelay(long _ulID, int _iNum);

	//3.9
	public native int NetClient_GetChannelNum(int _iLogonID, int[] _iChannelNum);

	//3.10            
	public native int NetClient_SetVideoPara(int _iLogonID, int _iChannelNum, VIDEOPARAM _strVideoParam);
	public native int NetClient_GetVideoPara(int _iLogonID, int _iChannelNum, VIDEOPARAM _strVideoParam);
        
	public native int NetClient_SetVideoQuality(int _iLogonID, int _iChannelNum, int _iVideoQuality, int _iStreamNO);
	public native int NetClient_GetVideoQuality(int _iLogonID, int _iChannelNum, int[] _iVideoQuality, int _iStreamNO);
	
	public native int NetClient_SetFrameRate(int _iLogonID, int _iChannelNum, int _iFrameRate, int _iStreamNO);
	public native int NetClient_GetFrameRate(int _iLogonID, int _iChannelNum, int[] _iFrameRate, int _iStreamNO);

	//3.13
	public native int NetClient_SetStreamType(int _iLogonID, int _iChannelNum, int _iStreamType, int _iStreamNO);
	public native int NetClient_GetStreamType(int _iLogonID, int _iChannelNum, int[] _iStreamType, int _iStreamNO);

	public native int NetClient_SetDateFormat(int _iLogonID, int _iFormat, char _cSeparate);
	public native int NetClient_GetDateFormat(int _iLogonID, int[] _iFormat, char[] _cSeparate);

	//3.21
	public native int NetClient_SetDeviceType(int _iLogonID,int _iChannelNum,int _iComNo,int _iDevAddress, String _pcProtocol);
	public native int NetClient_GetDeviceType(int _iLogonID,int _iChannelNum,int[] _iComPort, int[] _iDevAddress ,char[] _cDeviceType);

	public native int NetClient_SetComFormat( int _iLogonID,int _iComPort, String _cDeviceType, String _cComFormat,int _iWorkMode);
	public native int NetClient_GetComFormat(int _iLogonID, int _iCom, char[] _strComFormat,int[] _iWorkMode);

	public native int NetClient_DeviceCtrl(int _iLogonID, int _iChannelNum,int _iActionType, int _iParam1,int _iParam2);
	public native int NetClient_DeviceCtrlEx(int _iLogonID,int _iChannelNum,int _iActionType,int _iParam1,int _iParam2,int _iControlType);
	public native int NetClient_DevicePTZCtrl(int _iLogonID, int _iProtocolType, int _iActionType, int _iComNo, int _iAddress, int _iSpeed, int _iPresetNO);
	public native int NetClient_DevicePTZCtrlEX(int _iLogonID, int _iProtocolType, int _iActionType, int _iComNo, int _iAddress, int _iSpeed, int _iPresetNO, int _iChannelNum);

	public native int NetClient_ComSend(int _iLogonID, int[] _iBuf, int _iLength, int _iComNo);
	public native int NetClient_GetComPortCounts(int _iLogonID, int[] _piComPortCounts, int[] _piComPortEnabledStatus);

	//3.23
	public native int NetClient_SetIFrameRate(int _iLogonID, int _iChannelNum, int _iFrameRate, int _iStreamNO);
	public native int NetClient_GetIFrameRate(int _iLogonID, int _iChannelNum, int[] _iFrameRate, int _iStreamNO);
	public native int NetClient_ForceIFrame(int _iLogonID, int _iChannelNum, int _iStreamNO);

	//3.24
	public native int NetClient_SetTime (int _iLogonID, int _iyy, int _imo, int _idd, int _ihh, int _imi, int _iss);
	public native int NetClient_Reboot(int _iLogonID);
	public native int NetClient_GetServerVersion(int _iLogonID, String _strVer);

	//3.26
	public native int NetClient_GetUserNum(int _iLogonID,int _iUserNum);

	//3.28

	public native int NetClient_TalkStart(int _iLogonID, int _iUser);
	public native int NetClient_TalkEnd(int _iLogonID);
	public native int NetClient_GetTalkingState(int _iLogonID,int[] _iTalkState);

	//3.29
	public native int NetClient_CaptureBmpPic(int _ulConID, byte[] pcIP,int chanalNum, String _cFileName);

	//3.30
	public native int NetClient_ChangeSvrIP(int _iLogonID, String _strNewSvrIP, String _strMask, String _strGateway, String _strDNS);
	public native int NetClient_GetIpProperty(int _iLogonID, char[] _strMAC, char[] _strMask, char[] _strGateway, char[] _strDNS);

	//3.32
	public native int NetClient_GetVideoSize(int _iLogonID, int _iChannelNum, int[] _width, int[] _height, int _iStreamNO);
	public native int NetClient_SetVideoSize(int _iLogonID, int _iChannelNum, int _iVideoSize, int _iStreamNO);
	public native int NetClient_GetVideoSizeEx(int _iLogonID, int _iChannelNum, int[] _ivideoSize, int _iStreamNO);
	public native int NetClient_GetMaxMinorVideoSize(int _iLogonID, int[] _iMinorVideoSize);

	//3.46
	public native int NetClient_SetEncodeMode(int _iLogonID, int _iChannelNum, int _iStreamNO, int _iMode);
	public native int NetClient_GetEncodeMode(int _iLogonID, int _iChannelNum, int _iStreamNO, int[] _iMode);

	public native int NetClient_SetPreferMode(int _iLogonID, int _iChannelNum, int _iStreamNO, int _iMode);
	public native int NetClient_GetPreferMode(int _iLogonID, int _iChannelNum, int _iStreamNO, int[] _iMode);

	//3.48
	public native int NetClient_GetVideoNPMode(int _iLogonID, int[]_vMode);
	public native int NetClient_SetVideoNPMode(int _iLogonID, int _vMode);
	//3.49

	public native int NetClient_SetAudioEncoder(int _iLogonID, int _iChannel, int _iEncoder);
	public native int NetClient_GetAudioEncoder(int _iLogonID, int _iChannel, int[] _iCoder);
	
	//3.56
	public native int NetClient_GetFactoryID(int _iLogonID, String _strFactoryID);

	//3.60
	public native int NetClient_GetDevType(int _iLogonID,int[] _iDevType);
	public native int NetClient_GetProductType(int _iLogonID,int[] _iType);
	public native int NetClient_GetSysInfo(int _iLogonID);

	//3.67
	public native int NetClient_SetVencType(int _iLogonID,int _iChannelNum,int _iType);
	public native int NetClient_GetVencType(int _iLogonID,int _iChannelNum,int[] _iType);

	public native int NetClient_SetOutportState(int _iLogonID, int _iPort, int _iState);
	public native int NetClient_GetOutportState(int _iLogonID, int _iPort, int[] _iState);
	public native int NetClient_GetAlarmPortNum(int _iLogonID, int[] _iAlarmInPortNum, int[] _iAlarmOutPortNum);
	
	public native int NetClient_TurnLogon(String _strDirectorIP, int _iPort, String _strSerialID);
	public native int NetClient_TiandyDomainLogon(String _strDirectorIP, int _iPort, String _strDomain, String _strUsername, String _strPassword);
	
	//liulin
	public native int NSLook_LogonServer(char[] _cServerIP,int _iServerPort,boolean _blRepeat);
	public native int NSLook_LogoffServer(int _iID);
	public native int NSLook_Query(int _iID, REG_DNS _regDNS, REG_NVS _RegNVS,int _iType);
	public native int NSLook_ConnectNVS(int _iID, LogOnInfo _stLogOn, ProxyInfo _stProxy);
	public native int NSDomain_GetIPbyDNS(byte[] _cDomainName,char[] _cIP); //��������
	
	public native int NetClient_SetMaxKByteRate(int _iLogonID, int _iChannelNum, int _ibitRate, int _iStreamNO);
	public native int NetClient_GetMaxKByteRate(int _iLogonID, int _iChannelNum, int[] _ibitRate, int _iStreamNO);
	
	//3.50 
	public native int NetClient_NetFileQuery(int _iLogonID, PNVS_FILE_QUERY _fileQuery);
	public native int NetClient_NetFileQueryEx(int _iLogonID, PNVS_FILE_QUERY _pfileQuery, int _iSizeOfQuery);
	public native int NetClient_NetFileGetFileCount(int _iLogonID, int[] _iTotalCount, int[] _iCurrentCount);
	public native int NetClient_NetFileGetQueryfile(int _iLogonID, int _iFileIndex, PNVS_FILE_DATA _fileInfo); 
	public native int NetClient_NetFileManualRecord(int _iLogonID, int _iChannel, int _iState);   
	
	public native int NetClient_DrawTextOnVideo(int _iLogonID, int _iChannelNum, int _iX, int _iY, String _cText, int _iStore, int _iStreamNO);
	public native int NetClient_SetOsdText(int _iLogonID, int _iChannelNum, String _cTxtPtr, long _ulTextColor); 
	public native int NetClient_PlayFileState(int _iState);
	  
	//3G DVR       
	public native int NetClient_Set3GConfig(int _iLogonID, int _iCmd, int _iChannel, TDVR3GINFO _lpValueBuf, int _iBufSize);
	public native int NetClient_Get3GConfig(int _iLogonID, int _iCmd, int _iChannel, TDVR3GINFO _lpValueBuf, int _iBufSize);

	public native int NetClient_Snapshot(int _iLogonID, int _iChannel, int _iQvalue);
	
	public native int NetClient_NetFileDownloadFileEx(int[] _ulConID,int _iLogonID, String _cRemoteFilename, String _cLocalFilename);
	public native int NetClient_NetFileStopDownloadFile(int _ulID);
	public native int NetClient_NetFileGetDownloadPos(int _ulID, int[] _iPos, int[] _iDLSize);
	public native int NetClient_GetDownloadFailedFileName(int _iLogonID, int _iFileID, String _pcFileName, int _iFileNameBufSize);
	
	//wifi
	public native int NetClient_SetWifiParam(int _iLogonID, NVS_WIFI_PARAM _pWifiParam);
	public native int NetClient_GetWifiParam(int _iLogonID, NVS_WIFI_PARAM _pWifiParam);
	public native int NetClient_WifiSearch(int _iLogonID);
	public native int NetClient_GetWifiSearchResult(int _iLogonID, WIFI_INFO[] _pWifiInfo, int[] _iWifiCount);
	
	public native int NetClient_NetFileGetRecordState(int _iLogonID, int _iChannel, int[] _iState);
	
	public native int NetClient_Set3GDialog(int _iLogonID, int _iStartType,int _iStopType,int _iDuration);
	public native int NetClient_Get3GDialog(int _iLogonID, int[] _iStartType,int[] _iStopType,int[] _iDuration);
	
	public static NvssdkAPI instance = null;      
	public static NvssdkAPI GetInstance()
	{   
		if(instance == null)
		{
			instance = new NvssdkAPI();	
		}
		return instance;		
	}
	
	
}
